package com.geeguo.ebuilder.client.business.system.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.geeguo.ebuilder.client.base.tenant.model.DataContext;
import com.geeguo.ebuilder.client.business.system.excelimport.service.ExcelImportExecuteService;
import com.geeguo.ebuilder.client.business.system.user.model.*;
import com.geeguo.ebuilder.core.common.model.vo.PageListVO;

import java.util.Date;
import java.util.List;

public interface UserService extends IService<UserEntity>, ExcelImportExecuteService {

    PageListVO<UserVO> list(UserQuery query, DataContext dataContext);
    PageListVO<UserSimpleVO> listSimple(UserQuery query, DataContext dataContext);

    List<UserSimpleVO> search(String realName, DataContext dataContext);

    UserEntity get(String id, DataContext dataContext);
    UserEntity getByCertificate(String certificate, DataContext dataContext);
    UserCO getCached(String id, DataContext dataContext);

    boolean save(UserEntity user, List<String> roles, DataContext dataContext);
    boolean batchSave(List<UserEntity> list, DataContext dataContext);

    boolean update(UserEntity current, UserEntity old, List<String> roles, DataContext dataContext);

    boolean updatePassword(String id, String password, Date modifyTime, String modifyUser, DataContext dataContext);

    boolean updateLastLogin(String id, DataContext dataContext);

    boolean remove(String id, DataContext dataContext);

    boolean existsUsername(String username, DataContext dataContext);

    boolean existsMobile(String mobile, DataContext dataContext);

    boolean existsEmail(String email, DataContext dataContext);

    UserEntity initSuperAdmin(String username, String password, DataContext dataContext);
}
